{extend name="default/base" /}
{block name="css"}
<link rel="stylesheet" type="text/css" href="__STATIC__/plugins/mmgrid/mmGrid.css?v={$v}" />
{/block}
{block name="main"}
<div id='tab' class="wst-tab-box">
	<ul class="wst-tab-nav ">
		<li id="wst-msg-li-0">结算信息<span style="display:none;"></span></li>
		<li id="wst-msg-li-1">未结算订单<span style="display:none;"></span></li>
		<li id="wst-msg-li-2">已结算订单<span style="display:none;"></span></li>
	</ul>
	<div class="wst-tab-content" style='width:100%;'>
	    <div class='wst-tab-item'>
	       <div class="wst-toolbar">
	       <input type="text" id="settlementNo_0" style='width:120px;' autocomplete="off" placeholder="请输入结算单号"/>
						<select id='isFinish_0' autocomplete="off">
								<option value='-1'>结算状态</option>
								<option value='0'>未结算</option>
								<option value='1'>已结算</option>
								</select>
						<a class='s-btn btn btn-primary' onclick="loadGrid()"><i class="fa fa-search"></i>查询</a>
		   </div>
			<div class='wst-grid'>
				<div id="mmg1" class="mmg1"></div>
				<div id="pg1" style="text-align: right;"></div>
			</div>
        </div>
        {/** 待结算订单 **/}
        <div class='wst-tab-item'>
            <div class="wst-toolbar">
                <input type="text" id="orderNo_1" style='width:120px;' autocomplete="off" placeholder="请输入订单号"/>
				<a class='s-btn btn btn-primary' onclick="loadUnSettleGrid()"><i class="fa fa-search"></i>查询</a>
				<a class='s-btn btn btn-primary' style='width:110px;' onclick="settlement()"><i class="fa fa-shopping-bag"></i>申请结算</a>
            </div>
			<div class='wst-grid'>
				<div id="mmg2" class="mmg2"></div>
				<div id="pg2" style="text-align: right;"></div>
			</div>
        </div>
        <div class='wst-tab-item'>
            <div class="wst-toolbar">
            	<input type="text" id="settlementNo_2" style='width:120px;' autocomplete="off" placeholder="请输入结算单号"/>
				<input type="text" id="orderNo_2" style='width:120px;' autocomplete="off" placeholder="请输入订单号"/>
				<select id='isFinish_2' autocomplete="off">
							    <option value='-1'>结算状态</option>
								<option value='0'>未结算</option>
								<option value='1'>已结算</option>
						  </select>
				<a class='s-btn btn btn-primary' onclick="loadSettleGrid()"><i class="fa fa-search"></i>查询</a>
            </div>
			<div class='wst-grid'>
				<div id="mmg3" class="mmg3"></div>
				<div id="pg3" style="text-align: right;"></div>
			</div>
        </div>
	</div>

{/block}
{block name="js"}
<script src="__STATIC__/plugins/mmgrid/mmGrid.js?v={$v}" type="text/javascript"></script>
<script type='text/javascript' src='__SHOP__/settlements/settlements.js?v={$v}'></script>
	<script>
        $(function(){
            $('#tab').TabPanel({tab:0,callback:function(tab){
                    switch(tab){
                        case 0:getQueryPage({$p});break;
                        case 1:getUnSettledOrderPage({$p});break;
                        case 2:getSettleOrderPage({$p});break;
                    }
                }});
        });
	</script>
{/block}
